<?php


class Photo {

    private $id_photo;
    private $id_loc;
    private $lien_photo;
    private $descp_photo;


    public function __construct($valeur = array()){
        if(!empty($valeur)){
            $this->affecte($valeur);

        }
    }

    public function affecte($donnees){
        foreach ($donnees as  $attribut => $valeur){
            switch($attribut){
                case 'id_photo': $this->setIdPhoto($valeur);
                    break;
                case 'id_loc': $this->setIdLoc($valeur);
                    break;
                case 'lien_photo': $this->setLienPhoto($valeur);
                    break;
                case 'descp_photo': $this->setDescpPhoto($valeur);
                    break;

            }

        }
    }

    public function isEmpty(){
        return empty($this->id_loc)&&empty($this->id_photo)&&empty($this->lien_photo)&&empty($this->descp_photo)?true:false;
    }

    /**
     * @param mixed $descp_photo
     */
    public function setDescpPhoto($descp_photo)
    {
        $this->descp_photo = $descp_photo;
    }

    /**
     * @return mixed
     */
    public function getDescpPhoto()
    {
        return $this->descp_photo;
    }

    /**
     * @param mixed $id_loc
     */
    public function setIdLoc($id_loc)
    {
        $this->id_loc = $id_loc;
    }

    /**
     * @return mixed
     */
    public function getIdLoc()
    {
        return $this->id_loc;
    }

    /**
     * @param mixed $id_photo
     */
    public function setIdPhoto($id_photo)
    {
        $this->id_photo = $id_photo;
    }

    /**
     * @return mixed
     */
    public function getIdPhoto()
    {
        return $this->id_photo;
    }

    /**
     * @param mixed $lien_photo
     */
    public function setLienPhoto($lien_photo)
    {
        $this->lien_photo = $lien_photo;
    }

    /**
     * @return mixed
     */
    public function getLienPhoto()
    {
        return $this->lien_photo;
    }



} 